-
Notifications
You must be signed in to change notification settings - Fork 27.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unblock Llama2 ONNX export w/ sdpa by falling back to manual impl #28823
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Maybe add a unit test for the torch.jit.trace case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this! It's gonna be a bit hard to merge this. Would you mind checking if #27931 fixes the issue? It shall be merged before and should simplify all of that logic
Hi @ArthurZucker, I have validated the issue is fixed under your PR, thanks! Do you have an ETA when it will get merged? Our workstreams have been blocked by this issue for a while, we need to resolve this export issue asap. |
@@ -673,12 +673,22 @@ def forward( | |||
output_attentions: bool = False, | |||
use_cache: bool = False, | |||
) -> Tuple[torch.Tensor, Optional[torch.Tensor], Optional[Tuple[torch.Tensor]]]: | |||
_jit_tracing = torch.jit.is_tracing() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This means that we call torch.jit.is_tracing as many times as there are layers.
I don't understand why this change is necessary. The error that is normally raised
explicitly gives a solution. |
@ArthurZucker @BowenBao I believe we can close this issue now that #27931 was merged |
What does this PR do?
Unblocks Llama2 ONNX export with sdpa by falling back to manual implementation.
Fixes #28610
Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.
@fxmarty